home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copywrite © 1992-1993 David S. Blumenthal *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define BOXES 50 /* increase this for a finer grained but more timely effect */
- #define CorrectTime 2
-
- void BoxOutWipe(GrafPtr);
-
- void BoxOutWipe(GrafPtr myGrafPtr)
- {
- Rect theRect;
- int cenx, ceny;
- int boxnum;
-
- /* change this as appropriate for the source and destination bounds */
- cenx = MAIN_WINDOW_WIDTH / 2;
- ceny = MAIN_WINDOW_HEIGHT / 2;
-
- for(boxnum = 0; boxnum <= BOXES; boxnum++)
- {
- StartTiming();
-
- /* this is not the most efficient method, but the overhead of the
- multiplies and the redundant copying is hidden by the timing mechanism */
- theRect.left = cenx - ((boxnum * cenx) / BOXES);
- theRect.right = cenx + ((boxnum * cenx) / BOXES);
- theRect.top = ceny - ((boxnum * ceny) / BOXES);
- theRect.bottom = ceny + ((boxnum * ceny) / BOXES);
-
- CopyBits(&(myGrafPtr->portBits), &(gMainWindow->portBits),
- &theRect, &theRect, 0, 0L);
- TimeCorrection(CorrectTime);
- }
- }